package com.sky.context;

/**
 * 局部线程工具类，用于在线程中存储变量
 * @author moro
 * @date 2025/11/20
 */
public class BaseContext {

    // 单实例模式
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
